/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package CommonTools;

import java.io.Serializable;

/**
 * Класс администратора (нужен для списков и т.п.)
 * @author Julien Sorel
 */
public class Admin implements Serializable{

    //Поля класса
    private String name, fam, otch, tel, login, password, mail;
    protected int id, root;

    //Конструктор

    public Admin(int id, String name, String fam, String otch, String login, String password, int root, String mail, String phone)
    {
        this.id = id;
        this.name = name;
        this.fam = fam;
        this.otch = otch;
        this.login = login;
        this.password = password;
        this.mail = mail;
        this.setPhone(phone);
        this.setRoot(root);        
    }

    

    /*************************************************************
     * Геттеры и сеттеры
     ************************************************************/
    public boolean isRoot()
    {
        return this.root == 1;
    }

    public int getRoot()
    {
        return root;
    }

    public void setRoot(int root)
    {
        this.root = root;
    }


    
    public int getId()
    {
        return id;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public String getName()
    {
        return name;
    }

    public void setFam(String fam)
    {
        this.fam = fam;
    }

    public String getFam()
    {
        return fam;
    }

    public void setOtch(String otch)
    {
        this.otch = otch;
    }

    public String getOtch()
    {
        return this.otch;
    }

    public void setPhone(String phone)
    {
        this.tel = phone;
    }

    public void setPhone(int phone)
    {
        this.tel = Integer.toString(phone);
    }

    public String getPhone()
    {
        return this.tel;
    }

    public void setLogin(String login)
    {
        this.login = login;
    }

    public String getLogin()
    {
        return this.login;
    }

    public void setPassword(String password)
    {
        this.password = password;
    }

    public String getPassword()
    {
        return this.password;
    }

    public void setMail(String mail)
    {
        this.mail = mail;
    }

    public String getMail()
    {
        return mail;
    }

}
